# Author: Sanmu
# CreatTime: 2024/10/24
# Descriptior: 读取ini文件
import configparser
import pathlib

file = pathlib.Path(__file__).parents[0].resolve() / 'conf.ini'
def read_conf(section,option):
    conf = configparser.ConfigParser()
    conf.read(file)
    values = conf.get(section, option)
    return values

def write_conf(section,option,value):
    conf = configparser.ConfigParser()
    conf.read(file)
    conf.set(section,option,value)
    with open(file,'w') as f:
        conf.write(f)